import request from '@/utils/request'
import { getHost, getHeaderType } from '@/utils/host'

export function login(data) {
  return request({
    url: '/user/login/afterLogin',
    method: 'get',
    baseURL: getHost(),
    params: data,
    headers: getHeaderType()
  })
}

export function getInfo(token) {
  return request({
    url: '/user/login/afterInfo',
    method: 'get',
    baseURL: getHost(),
    headers: getHeaderType(),
    params: { token: token }
  })
}

export function logout(token) {
  return request({
    url: '/user/login/afterLogOut',
    method: 'post',
    baseURL: getHost(),
    headers: getHeaderType(),
    params: { token: token }
  })
}

export function updateLogin(data) {
  return request({
    url: '/user/login/afterLogOut',
    method: 'post',
    baseURL: getHost(),
    headers: getHeaderType(),
    data: data
  })
}
